UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lCa68+jq2tU1bof4RWgLSS6Cb4KnvpFKJ85gtZCWg0k=' 
WHERE 
  key_id = '6baa0e3859aa54672a222a426f582acfdb4eb0788b4b5cf24b26b7ebab781ea0' 
  AND (
    token = 'lCa68+jq2tU1bof4RWgLSS6Cb4KnvpFKJ85gtZCWg0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026