UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BFml8MSEG76RXmhB5nznSy6JUeEFEpwZAqZCiC//M1k='
WHERE
key_id = '56537ca08d0a1114eeb104df328172bb670fb8600d76c5ae772ea7f61fed893e'
AND (
token = 'BFml8MSEG76RXmhB5nznSy6JUeEFEpwZAqZCiC//M1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)