UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mG2f448BWhC8ehG/gIqjzM9+M1joyUEP3m5cMNtESEo='
WHERE
key_id = 'b6df8c10c7b6a0f0866e31ae7ba20cba59bc1607bc7d7fbf2805baa7ecb86b99'
AND (
token = 'mG2f448BWhC8ehG/gIqjzM9+M1joyUEP3m5cMNtESEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)