UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GNFbEVIjG2LPL2Fft8xKOmjYrorzvDfihateBNffNnY=' 
WHERE 
  key_id = '4384b04bc1f67ac56b1e704fc99d3514a07ed91adb92d3605562e627c686a590' 
  AND (
    token = 'GNFbEVIjG2LPL2Fft8xKOmjYrorzvDfihateBNffNnY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016