UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2aRKdyGmBK0/f/IqGJdSPv7TksHy5NCkXIC+qvi1QIA=' 
WHERE 
  key_id = 'e0efa447fea49062556125deb4eb7c72435eccdd8f5af45471787933aba65532' 
  AND (
    token = '2aRKdyGmBK0/f/IqGJdSPv7TksHy5NCkXIC+qvi1QIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026