UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ITejsAhb2fHvBeHPUOzIkoyVjBqy0sDUOEDUDjNBzoI='
WHERE
key_id = '734dd5a3cb17713ee55453d80e616e27c1d73274813d12f7f582ff144f66c4d2'
AND (
token = 'ITejsAhb2fHvBeHPUOzIkoyVjBqy0sDUOEDUDjNBzoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)