UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cnRXRJJf1bNQSeestDIzclmEIlQjvIyTAbhxbrsTfxE='
WHERE
key_id = 'c96d84dfbe16ad1e86c57672ec4a650fb1a4a9f1d1387e69aae95bf2deed9893'
AND (
token = 'cnRXRJJf1bNQSeestDIzclmEIlQjvIyTAbhxbrsTfxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)