UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pcx2hKls1FA6zajxZSLxdm3tASFFvctP8HhUf++n+1g=' 
WHERE 
  key_id = 'e95e242241390c41417a0239c20bf2e67bade712ee569a8686fba2ebf9e6644c' 
  AND (
    token = 'Pcx2hKls1FA6zajxZSLxdm3tASFFvctP8HhUf++n+1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037