UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dYsoOh2+ApWlLJV7r7Tfnhht2udCVD/wmWehXJDIEWk='
WHERE
key_id = '54871952d0d758fd7c7b3b2ec3dcc060a135ee4abbddac5525b08a2a73bb9499'
AND (
token = 'dYsoOh2+ApWlLJV7r7Tfnhht2udCVD/wmWehXJDIEWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)