UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xTMsJGyIoh6lB6eJLlAr7oupPsLst4ceX57p6C2EUPY='
WHERE
key_id = '4b8c85794de9c6d2fdb0c98fb30dc1f80fdd1288682c1bd04aba211cb14b5a86'
AND (
token = 'xTMsJGyIoh6lB6eJLlAr7oupPsLst4ceX57p6C2EUPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)