UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CzAPzDQ3GO+yIa1I0rBpWmA4hUnj2/ZKNlHci/Xuv6I=' 
WHERE 
  key_id = 'cd2b9c60502cdd9ee475db3c4326300c164514c743bd86282c53602d1862786c' 
  AND (
    token = 'CzAPzDQ3GO+yIa1I0rBpWmA4hUnj2/ZKNlHci/Xuv6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025