UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GxQgAeOSHS5Fl6xQJhidG/UCDKlRyBOJsQf31LFBhmk=' 
WHERE 
  key_id = '57f47cdf7f66a67d04020532b9abe2e189b285f55ddefee715212be0d88011a7' 
  AND (
    token = 'GxQgAeOSHS5Fl6xQJhidG/UCDKlRyBOJsQf31LFBhmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044