UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9bEsDWrs0a1ZjKMtMpNb9QHdgVnKEg3Eq5GRhr4ltjI=' 
WHERE 
  key_id = '2f9b4a3b5bf58adf1dbd01112d4f8e83d262ef5db8ddb2ce5654d82d1df9bf95' 
  AND (
    token = '9bEsDWrs0a1ZjKMtMpNb9QHdgVnKEg3Eq5GRhr4ltjI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049