UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm7nJF4/uXddqrJtmGoIeEFY5HNWC31Oz5tlCjuUyiMs='
WHERE
key_id = 'c863c69e9bbc4efac52914f036032b30b3259af617661bc0e2a6e48fe7ebd417'
AND (
token = 'm7nJF4/uXddqrJtmGoIeEFY5HNWC31Oz5tlCjuUyiMs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)