UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VaOqPAss7goke7+fbA6FJK69Nhr8HNlNcGNkKPl2pIE='
WHERE
key_id = 'cff5fb2155b4b0b1ab92c2811cdcea49ef058c69600a7a193a47effb8f241771'
AND (
token = 'VaOqPAss7goke7+fbA6FJK69Nhr8HNlNcGNkKPl2pIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)