UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kojw3li5/UDylV/s+WCSy+I4X6qITr5b9kYVNHCl7H0=' 
WHERE 
  key_id = 'c017695074a57ec0a78ecd90c25e573a31714f3c8ced02250eed7ff47ed32b33' 
  AND (
    token = 'Kojw3li5/UDylV/s+WCSy+I4X6qITr5b9kYVNHCl7H0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031