UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xEjSQf5vy/GLihMU3ibjRNhDU3uSadR6X8sKM0xBAV8='
WHERE
key_id = '400d1760d31a9f8ec5e9781148b8f5e2e46a1d24d955c16888b5c620bf7ccc27'
AND (
token = 'xEjSQf5vy/GLihMU3ibjRNhDU3uSadR6X8sKM0xBAV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)