UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zdh2aiLBrXVSJehuglgi6aX1uHimLE9mZG/GhlIrRKo='
WHERE
key_id = '9f464cfc1730fa8b29f5dc0c3d4197922c55dc32488fafab1c1acb0ba177183b'
AND (
token = 'zdh2aiLBrXVSJehuglgi6aX1uHimLE9mZG/GhlIrRKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)