UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AnTmU34OpIFpbKsWOkw0NUbGq/5GdxetKOzA0EBoYnI='
WHERE
key_id = '70a9c345363861bfb40ab68eb895423287ff995208c202a43938ba73b3ae9688'
AND (
token = 'AnTmU34OpIFpbKsWOkw0NUbGq/5GdxetKOzA0EBoYnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)