UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sux4vWB8+pwMvnZOxi2RTR/WAw9ar0OAEwD8hfzwLx8='
WHERE
key_id = '5c63a8f185cfe61aaf35608e780010119e020f4a2ef36d26afee4bf20c8f73e0'
AND (
token = 'Sux4vWB8+pwMvnZOxi2RTR/WAw9ar0OAEwD8hfzwLx8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)