UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JA1la3nYHL1wKOpWMNzvm4q9lbqIxFAbRMV4FIPcKLk='
WHERE
key_id = 'ec082c3c79e1306e0f792c63e153bd338b24db8b26d8e99cf54f8a75c84f4dbc'
AND (
token = 'JA1la3nYHL1wKOpWMNzvm4q9lbqIxFAbRMV4FIPcKLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)