UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EOuEpIOnkWT2yYgD3i6nG/68CxJyaU/CISr8IW/WUtE='
WHERE
key_id = '0e06771917347b4203093dd0863c7530a02ecc79ea4a65fae0a7aff01f871b80'
AND (
token = 'EOuEpIOnkWT2yYgD3i6nG/68CxJyaU/CISr8IW/WUtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)