UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q8wXEYXSc1Iv4shelshFipVR7tL1QCzuINyfVo6s0cY='
WHERE
key_id = '4019f75e74642671d7e5b8a2ae916e9d5401ac15deeb3b075c1536d211d90f8f'
AND (
token = 'Q8wXEYXSc1Iv4shelshFipVR7tL1QCzuINyfVo6s0cY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)