UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ekkNVTKXbWLaPCI/EIbQUWTuo7lVWeuaP59d8vufUzE='
WHERE
key_id = '05662e4452b64ade0200c681d609a5bb30c6b3e0c359d66f37c6dc01807f2458'
AND (
token = 'ekkNVTKXbWLaPCI/EIbQUWTuo7lVWeuaP59d8vufUzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)