UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rM3U1aS2NmQaBmAt1aCMLZLQozovhRaJsEzRHhn0KNM=' 
WHERE 
  key_id = '7d4c848a874fb8fe11827be8f8088ee79d080974990bf969405b3710db51e398' 
  AND (
    token = 'rM3U1aS2NmQaBmAt1aCMLZLQozovhRaJsEzRHhn0KNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031