UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oCr4LIxP6AvfTSxSXYlBIMlJ3rbUVAZ5Kaj5rvThc8c=' 
WHERE 
  key_id = '8097f1dda521c31748ecc5ff9f54f5f853dc67427da0f7808956a4e93552f03f' 
  AND (
    token = 'oCr4LIxP6AvfTSxSXYlBIMlJ3rbUVAZ5Kaj5rvThc8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041