UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5LwYNtccI7TRkxJOqauwhiaWvvYqDYn8a7nKZtT80V0=' 
WHERE 
  key_id = '0cbeccdb4f795a36e5185407905b78109d0a1305cae0b33c4b765e33efd84bc6' 
  AND (
    token = '5LwYNtccI7TRkxJOqauwhiaWvvYqDYn8a7nKZtT80V0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016