UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kyzdORkJ1Bj77QeqE1Ry62svuCdsHrsc4pu3PpJwqM='
WHERE
key_id = 'cbd1bd7c1bde798910600c0acb3a53d1daaffaad9285ad48a4eceda8633c5279'
AND (
token = '0kyzdORkJ1Bj77QeqE1Ry62svuCdsHrsc4pu3PpJwqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)