UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cRbACjeeT+vRXxC1yiZl8rfAe2j+aZC0RIcVQPZBzL0='
WHERE
key_id = '1a1c1be8a7695aba7c5fe2c819dee235933f1d3a9491fa98cedd6250b08d6b88'
AND (
token = 'cRbACjeeT+vRXxC1yiZl8rfAe2j+aZC0RIcVQPZBzL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)