UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'on08q+kUDUrozkJdhsLu5KMl7591UtosJyuhpJ5J+LA=' 
WHERE 
  key_id = '00b54391bf5b9eb187c08eae5b6ca550e78ab3fdc40f388224500a7d3941eb40' 
  AND (
    token = 'on08q+kUDUrozkJdhsLu5KMl7591UtosJyuhpJ5J+LA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034