UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zKAkvhw0+A2+bfcFZZeLb6B6yz1wSzuWKCP6paItmQ='
WHERE
key_id = '61ecbc626c8002ced62e6677a64cff94978214f43372d0350bd87f5184eca38d'
AND (
token = '4zKAkvhw0+A2+bfcFZZeLb6B6yz1wSzuWKCP6paItmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)